package com.ktjy.springthymeleaf.controller;


import com.ktjy.springthymeleaf.entity.Role;
import com.ktjy.springthymeleaf.service.RoleService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @return 13141
 * 2025/7/18
 * 09:25
 */
@Controller
public class RoleController {
    @Resource
    private RoleService roleService;

    @GetMapping("/role/list")
    public String findRoles(Model model) {
        List<Role> list = roleService.findAll();
        model.addAttribute("rolePage", list);
        return "/role/list";
    }
}
